function openOnClick() {
	var tabletools = TableTools.fnGetInstance('table');
	var list = new Array();
	list = tabletools.fnGetSelected();
	var selectedValue = '';

	for ( var i = 0; i < tabletools.fnGetSelected().length; i++) {
		var value = tabletools.fnGetSelected()[i].getElementsByTagName("td")[0].innerHTML;
		selectedValue = value;

	}
	$("[id='brands_form:selected_brand_name']").val(selectedValue);

	if (selectedValue == '') {
		alert("Please select a row first!");
		return false;
	} else {
		return true;
	}
}
function deleteOnClick(name) {
	var tabletools = TableTools.fnGetInstance('table');
	var list = new Array();
	list = tabletools.fnGetSelected();
	var selectedValue = '';

	for ( var i = 0; i < tabletools.fnGetSelected().length; i++) {
		var value = tabletools.fnGetSelected()[i].getElementsByTagName("td")[0].innerHTML;
		selectedValue = value;

	}
	$("[id='brands_form:selected_brand_name']").val(selectedValue);

	if (selectedValue == '') {
		alert("Please select a row first!");
		return false;
	}
	var r = confirm("Are you sure to delete Brand: " + selectedValue + "?");
	if (r != true) {
		return false;
	} else {
		return true;
	}
}

function createOnClick() {
	return false;
}